<template>
  <div class="nav_header">
    <div class="nav_header_container">
      <!-- 导航栏左侧 -->
      <div class="header_left" @click="goPage('/profile')">
        <img :src="Avatar" alt="" />
      </div>
      <!-- 导航栏右侧 -->
      <div class="header_right">
        <div>
          <img :src="LanguageIcon" alt="" @click="goPage('/profile/settings/language')" />
        </div>
        <div>
          <img :src="ConsultIcon" alt="" @click="goPage('/profile/service')" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import Avatar from "@/assets/home/avatar.png";
import LanguageIcon from "@/assets/home/language_icon.png"
import ConsultIcon from "@/assets/home/consult_icon.png"
import { useRouter } from "vue-router";

// 获取路由对象
const router = useRouter()

// 跳转指定页
const goPage = (path: string) => {
  router.push(path)
}
</script>

<style lang="scss" scoped>
.nav_header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  background-color: #030303;
  z-index: 10;
  .nav_header_container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    img {
      width: 24px;
      height: 24px;
    }
    .header_left {
      display: flex;
      align-items: center;
    }
    .header_right {
      display: flex;
      & > div {
        display: flex;
        align-items: center;
        margin-left: 15px;
      }
    }
  }
}
</style>
